package com.homeinns.esserver.service.impl;

import com.homeinns.esserver.dataobject.TestUser;
import com.homeinns.esserver.exception.TestUserException;
import com.homeinns.esserver.repository.TestUserRepository;
import com.homeinns.esserver.service.TestUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName TestUserServiceImpl
 * @Description TODO
 * @Author 樊志强
 * @Date 2018/9/29 16:16
 **/
@Service
public class TestUserServiceImpl implements TestUserService {

    @Autowired
    private TestUserRepository testUserRepository;

    @Override
    public TestUser findById(String id) throws TestUserException {
        return testUserRepository.findById(id).orElseThrow(()->new TestUserException(100, "此用户不存在"));
    }
}
